home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Wild Blue Yonder 1: 50 Years of Gs & Jets
/
Wild Blue Yonder - Episode 1 - 50 Years of Gs and Jets (Digital Ranch) (Spectrum Holobyte)(1-107-40-101)(1994).iso
/
control
/
printext.dir
/
00151_Script_151
< prev
next >
Wrap
Text File
|
1994-08-29
|
9KB
|
392 lines
on startMovie
set the keyDownScript = "if the key = RETURN then printText"
end startMovie
on print
global cancelPrint, doPrint, doPrintBorder, machine, printBox, ¼
printQuestion, watch, Win
set the puppet of sprite printBox = TRUE
set the puppet of sprite printQuestion = TRUE
set the puppet of sprite cancelPrint = TRUE
set the puppet of sprite doPrint = TRUE
set the puppet of sprite doPrintBorder = TRUE
set the locV of sprite printBox = 1000
set the locV of sprite printQuestion = 1000
set the locV of sprite cancelPrint = 1000
set the locV of sprite doPrint = 1000
set the locV of sprite doPrintBorder = 1000
updateStage
if the machineType = Win then WinPrint
else MacPrint
go to frame (machine & "print") of movie "panel"
end print
on WinPrint -- "DPWprint"
global HDroot, storyText
put RETURN&numToChar(10) into recordEnd -- <RETURN> <LINEFEED>
put HDroot & "PRINT.TXT" into theFileName
set file = FileIO(mNew, "write", theFileName)
-- First set an offset for the printing page:
file( mWriteString, "@ORIX" && 30 & recordEnd )
file( mWriteString, "@ORIY" && 40 & recordEnd )
set castNr to the castNum of sprite storyText
file( mWriteString, ¼
"@POSX" && the locH of sprite storyText & recordEnd )
file( mWriteString, ¼
"@POSY" && the locV of sprite storyText & recordEnd )
file( mWriteString, ¼
"@FONT" && the textFont of field castNr & recordEnd )
file( mWriteString, ¼
"@SIZE" && the textSize of field castNr & recordEnd )
put the textStyle of field castNr into style
repeat with lineNr = 1 to the number of lines in field castNr
file( mWriteString, line lineNr of field castNr & recordEnd )
end repeat
file( mDispose )
open "AV_PRINT.EXE"
end WinPrint
on MacPrint -- "PrintShop"
global CDroot, printFile, storyText
set textOut = fileIO( mNew, "write", printFile )
textOut( mWriteString, ¼
field (the number of cast (the castNum of sprite storyText)))
set textIn = fileIO( mNew, "read", printFile )
set printText = textIn( mReadToken, "", "" )
openXLib CDroot & "PrintShop"
set printObj = printShop( mNew )
if printObj( mDoPageSetup ) then
if printObj( mDoJobSetup ) then
printObj( mSetProgressMsg, ¼
"Press command-period to cancel printing.")
printObj( mPrint, printText )
end if
end if
textOut( mDispose )
textIn( mDispose )
printObj( mDispose )
closeXLib CDroot & "PrintShop"
end MacPrint
----------------------------------------------------------------------------------------
-- Handlers in this section control the ambient sound.
----------------------------------------------------------------------------------------
on startAmbience
chooseChannels
crossFade
end startAmbience
-- countSounds examines the ambience array to find out how many ambient
-- sounds are associated with the movie. It stores the total in a
-- variable called overviewSounds.
on countSounds
global overviewSounds, ambience, ambienceCode
set overviewSounds = 0
set contents = 1
set pointer = ambienceCode
repeat while pointer < (ambienceCode + 99)
set contents = ambience( mGet, pointer )
if contents = 0 then
exit repeat
end if
set pointer = pointer + 1
set overviewSounds = overviewSounds + 1
end repeat
end countSounds
on chooseChannels
global fadeInLength, inChannel, outChannel
if (the volume of sound 1 > the volume of sound 2) or ¼
((the volume of sound 1 < the volume of sound 2) and ¼
(playTime() < fadeInLength/2)) then
set inChannel = 1
set outChannel = 2
else
set inChannel = 2
set outChannel = 1
end if
end chooseChannels
-- crossFade chooses a new cut to play, then fades it in while fading
-- out the old one.
on crossFade
global inChannel, outChannel, fadeOutLength, fadeInLength
set temp = inChannel
set inChannel = outChannel
set outChannel = temp
chooseCut
initFadeOut( outChannel )
fadeOut( outChannel, fadeOutLength )
initFadeIn( inChannel )
fadeIn( inChannel, fadeInLength )
playCut
end crossFade
on checkAmbience
global fadedIn, fadedOut, inChannel, outChannel, fadeInLength, fadeOutLength
if not soundBusy( inChannel ) and not soundBusy( outChannel ) then startAmbience
if not fadedIn then fadeIn( inChannel, fadeInLength )
if not fadedOut then fadeOut( outChannel, fadeOutLength )
if nearEnd() then crossFade
end checkAmbience
-- chooseCut randomly selects the number of the next cut to play. If possible, it
-- never repeats the same cut twice in a row.
on chooseCut
global cut, overviewSounds, oldOverviewSound
set i = random( overviewSounds )
set cut = 1 + (i - 1)
if overviewSounds > 1 then -- If there are two or more choices, don't repeat.
if cut = oldOverviewSound then
chooseCut
else
set oldOverviewSound = cut
end if
end if
end chooseCut
-- nearEnd checks to see whether the current audio selection has reached
-- the point at which it should start fading out. (Values were assigned
-- to the array called "fadePoint" in the Overview movie.)
on nearEnd
global cut, fadePoint
if playTime() < fadePoint( mGet, cut ) then
return FALSE
else
return TRUE
end if
end nearEnd
on initFadeOut channel
global bgVol, lastTimeOut, startVol, fracSumOut, fadedOut, volumes
set lastTimeOut = the timer
set startVol = volumes( mGet, bgVol )
set fracSumOut = 0
set fadedOut = FALSE
end initFadeOut
on fadeOut channel, length
global lastTimeOut, startVol, fracSumOut, fadedOut
if the timer > lastTimeOut then
set elapsedTime = (the timer - lastTimeOut) * 1.0000000
set lastTimeOut = the timer
set increment = (elapsedTime/length) * startVol
set increment = storeFractionOut( increment )
if fracSumOut >= 1 then
set increment = increment + 1
set fracSumOut = fracSumOut - 1
end if
set the volume of sound channel = ¼
(the volume of sound channel) - increment
if (the volume of sound channel) = 0 then
sound stop channel
set fadedOut = TRUE
end if
end if
end fadeOut
on initFadeIn channel
global lastTimeIn, maxVol, volumes, bgVol, fracSumIn, fadedIn
set the volume of sound channel = 0
set lastTimeIn = the timer
set maxVol = volumes( mGet, bgVol )
set fracSumIn = 0
set fadedIn = FALSE
end initFadeIn
on fadeIn channel, length
global lastTimeIn, maxVol, fracSumIn, fadedIn, volumes, bgVol
if the timer > lastTimeIn then
set elapsedTime = (the timer - lastTimeIn) * 1.0000000
set lastTimeIn = the timer
set increment = (elapsedTime/length) * maxVol
set increment = storeFractionIn( increment )
if fracSumIn >= 1 then
set increment = increment + 1
set fracSumIn = fracSumIn - 1
end if
if ((the volume of sound channel) + increment) < maxVol then
set the volume of sound channel = (the volume of sound channel) + increment
else
set the volume of sound channel = maxVol
set fadedIn = TRUE
end if
end if
end fadeIn
on storeFractionOut n
global fracSumOut
set int = integer( n )
set frac = n - int
if frac < 0 then
set frac = frac + 1
set int = int - 1
end if
set fracSumOut = fracSumOut + frac
return int
end storeFractionOut
on storeFractionIn n
global fracSumIn
set int = integer( n )
set frac = n - int
if frac < 0 then
set frac = frac + 1
set int = int - 1
end if
set fracSumIn = fracSumIn + frac
return int
end storeFractionIn
-- playCut plays an audio selection
on playCut
global inChannel, ambience, ambiencePath, CDroot, cut
set selection = string( ambience( mGet, cut ))
sound playFile inChannel, CDroot & ambiencePath & selection
startCutTimer
end playCut
on startCutTimer
global cutStartTime
set cutStartTime = the timer
end startCutTimer
on playTime
global cutStartTime
return the timer - cutStartTime
end playTime
on stopAmbience
set the volume of sound 1 = 0
set the volume of sound 2 = 0
end stopAmbience